package com.jasmine.bjstkserver.server.web;

import com.jasmine.auth.util.AuthUtil;
import com.jasmine.core.dto.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author : jasmineXz
 */
@RestController
@RequestMapping("/web")
public class WebController {

    @Autowired
    private WebService webService;

    /**
     * 查询web列表
     * @return web列表
     */
    @GetMapping
    public R findList() {
        return R.ok(webService.findList(AuthUtil.getUserId()));
    }


    /**
     * 新增收藏
     */
    @RequestMapping("/clear")
    public R insert() {
        webService.clearCache(AuthUtil.getUserId());
        return R.ok();
    }

}
